import os
import sys
import time

#cmd = 'ps -ef | grep "myIBClient 44"| grep -v grep'
#cmd = 'pgrep -f "myIBClient 44"'
#res = os.popen(cmd)
#pidlist = res.readlines()
#pidlist = [x.strip()for x in pidlist]
#cmd = "kill -9 %s"%(' '.join(pidlist))
program = "myIBClient 44"
cmd = 'pgrep -f "%s"| xargs kill -9'%(program)
os.system(cmd)
print("KILLED sleep 2s")
time.sleep(2)
cmd = './%s >log &'%(program)
os.system(cmd)
print("START")
